<?php $this->headScript()->appendFile(HTTP_HOST.'/js/site-manager/references.js'); ?>

<?php if (sizeof($this->references) < 1) { ?>
	<h4>Отзывов еще нет</h4>
<?php } else { ?>
	<table border="1" class="references">
		<tr>
			<th>
				Дата
			</th>
			<th>
				Автор
			</th>
			<th>
				Email
			</th>
			<th>
				Утвержден
			</th>
			<th>
				&nbsp;
			</th>
		</tr>
		<?php foreach ($this->references as $r) { ?>
		<tr>
			<td>
				<?=date('m/d/Y H:i:s', strtotime($r['Created']))?>
			</td>
			<td>
				<?=stripslashes($r['Name'])?>
			</td>
			<td>
				<?=stripslashes($r['Email'])?>
			</td>
			<td>
				<a onclick="changeApproved(<?=$r['ID']?>)"><?=$r['Approved'] == 1 ? 'Да' : 'Нет'?></a>
			</td>
			<td>
				<a href="<?=HTTP_HOST?>/site-manager/references/edit?id=<?=$r['ID']?>">Редактировать</a>
				<a onclick="deleteReference(<?=$r['ID']?>);">Удалить</a>
			</td>
		</tr>
		<?php } ?>
	</table>
<?php } ?>